<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>订单修改</title>
	<!-- 公共样式 开始 -->
	<link rel="stylesheet" type="text/css" href="Resources/css/base.css">
	<link rel="stylesheet" type="text/css" href="Resources/css/iconfont.css">
	<script type="text/javascript" src="Resources/framework/jquery-1.11.3.min.js"></script>
	<link rel="stylesheet" type="text/css" href="Resources/layui/css/layui.css">
	<script type="text/javascript" src="Resources/layui/layui.js"></script>
	<!-- 滚动条插件 -->
	<link rel="stylesheet" type="text/css" href="Resources/css/jquery.mCustomScrollbar.css">
	<script src="Resources/framework/jquery-ui-1.10.4.min.js"></script>
	<script src="Resources/framework/jquery.mousewheel.min.js"></script>
	<script src="Resources/framework/jquery.mCustomScrollbar.min.js"></script>	
	<script type="text/javascript" src="Resources/js/check.js"></script>
	<style>
		.layui-form-label {
			width: 100px;
		}
		
		.layui-input-block {
			margin-left: 130px;
		}
		
		.layui-form {
			margin-right: 30%;
		}
	</style>
	<base target="_parent" />
</head>
<body>
	<div class="cBody">
		<form id="addForm" class="layui-form" action="listOrder?status=update" method="post">
			<div class="layui-form-item">
				<label class="layui-form-label">订单ID</label>
				<div class="layui-input-block">
					<a class="layui-input">${order.oid}</a>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">用户</label>
				<div class="layui-input-inline">
                  	 <select name="uid">
						<option value="${order.user.uid}">${order.user.uname}</option>
						<c:forEach items="${userlist}" var="user" varStatus="st">
							<option value="${user.uid}">${user.uname}</option>
						</c:forEach>
					</select>	
                </div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品</label>
				<div class="layui-input-inline">
                    <select name="gid">
						<option value="${order.good.gid}">${order.good.gName}</option>
						<c:forEach items="${goodlist}" var="good" varStatus="st">
							<option value="${good.gid}">${good.gName}</option>
						</c:forEach>
					</select>
                </div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品单价</label>
				<div class="layui-input-block">
                    <input type="text" name="gprice" value="${order.good.gPrice}" readonly="readonly" required lay-verify="required|number" autocomplete="off" class="layui-input">
                </div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">订单数量</label>
				<div class="layui-input-block">
					<input type="text" name="num" value="${order.oNum}" required lay-verify="required|number" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">订单状态</label>
				<div class="layui-input-inline">
					<select name="stat" lay-filter="stat" id="stat">
							<option value="1">未完成</option>
							<option value="0">已完成</option>
					</select>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="hidden" name="oid" value="${order.oid}">
					<button class="layui-btn" lay-submit lay-filter="submitBut">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</form>
	</div>
	<script>
		layui.use('layedit', function() {
			var layedit = layui.layedit,
				$ = layui.jquery;

			//构建一个默认的编辑器
			var index = layedit.build('shopDetail');

			//编辑器外部操作
			var active = {
				content: function() {
					alert(layedit.getContent(index)); //获取编辑器内容
				},
				text: function() {
					alert(layedit.getText(index)); //获取编辑器纯文本内容
				},
				selection: function() {
					alert(layedit.getSelection(index));
				}
			};

			$('.site-demo-layedit').on('click', function() {
				var type = $(this).data('type');
				active[type] ? active[type].call(this) : '';
			});
		});
	</script>
</body>
</html>